package mylab.usm.oauth2.client.config;

import jakarta.annotation.PostConstruct;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;

@Slf4j
@EnableConfigurationProperties({AuthProperties.class})
@Configuration(proxyBeanMethods = false)
public class AuthConfiguration {

    @Autowired
    private AuthProperties properties;


    @PostConstruct
    void init() {
        log.info("Init AuthConfiguration");
        JapConfigContext.sso = properties.isSso();
        JapConfigContext.domain = properties.getDomain();
    }

}
